{extend name="layout:base" /}

{block name="content"}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <form class="layui-form">
                <input type="hidden" name="id" value="{$article.id}">
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">用户名：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="username" value="{$article.username}" disabled class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">*用户登录系统帐号</div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">公司名称：</label>
                    <div class="layui-input-block">
                        <input type="text" name="company" value="{$article.company}" class="layui-input">
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">网站名称：</label>
                    <div class="layui-input-block">
                        <input type="text" name="web_name" value="{$article.web_name}" class="layui-input">
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">网站域名：</label>
                    <div class="layui-input-block">
                        <input type="text" name="web_url" value="{$article.web_url}" class="layui-input">
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">LOGO：</label>
                    <div class="layui-input-block">
                        <input type="text" name="web_logo" value="{$article.web_logo}" class="layui-input">
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">ico图标：</label>
                    <div class="layui-input-block">
                        <input type="text" name="web_ico" value="{$article.web_ico}" class="layui-input">
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">网站电话：</label>
                    <div class="layui-input-block">
                        <input type="text" name="web_tel" value="{$article.web_tel}" class="layui-input">
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">网站qq：</label>
                    <div class="layui-input-block">
                        <input type="text" name="web_qq" value="{$article.web_qq}" class="layui-input">
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">网站邮箱：</label>
                    <div class="layui-input-block">
                        <input type="text" name="web_email" value="{$article.web_email}" class="layui-input">
                    </div>
                </div>
                <div class="layui-row  layui-form-item">
                    <label class="layui-form-label">备案号：</label>
                    <div class="layui-input-block">
                        <input type="text" name="web_icp" value="{$article.web_icp}" class="layui-input">
                    </div>
                </div>
                <div class="layui-row layui-form-item">
                    <label class="layui-form-label">地址：</label>
                    <div class="layui-input-block">
                        <input type="text" name="web_address" value="{$article.web_address}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">价格方案：</label>
                    <div class="layui-input-block layui-row ">
                        <div class="layui-col-md4 layui-col-sm6 layui-col-xs12">
                            <label class="layui-form-label">百度：</label>
                            <div class="layui-input-inline">
                                {if condition="$article.baidu >0"}
                                <input type="text" name="baidu" value="{$article.baidu}" class="layui-input">
                                {else}
                                <input type="text" name="baidu" value="{$config_price.baidu}" class="layui-input">
                                {/if}
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6 layui-col-xs12">
                            <label class="layui-form-label">百度移动：</label>
                            <div class="layui-input-inline">
                                {if condition="$article.baiduM >0"}
                                <input type="text" name="baiduM" value="{$article.baiduM}" class="layui-input">
                                {else}
                                <input type="text" name="baiduM" value="{$config_price.baiduM}" class="layui-input">
                                {/if}
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6 layui-col-xs12">
                            <label class="layui-form-label">360：</label>
                            <div class="layui-input-inline">
                                {if condition="$article.so >0"}
                                <input type="text" name="so" autocomplete="off" class="layui-input" value="{$article.so}">
                                {else}
                                <input type="text" name="so" autocomplete="off" class="layui-input" value="{$config_price.so}">
                                {/if}

                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6 layui-col-xs12">
                            <label class="layui-form-label">360移动：</label>
                            <div class="layui-input-inline">
                                {if condition="$article.soM >0"}
                                <input type="text" name="soM" autocomplete="off" class="layui-input" value="{$article.soM}">
                                {else}
                                <input type="text" name="soM" autocomplete="off" class="layui-input" value="{$config_price.soM}">
                                {/if}
                            </div>
                        </div>

                        <div class="layui-col-md4 layui-col-sm6 layui-col-xs12">
                            <label class="layui-form-label">搜狗：</label>
                            <div class="layui-input-inline">
                                {if condition="$article.sougou >0"}
                                <input type="text" name="sougou" autocomplete="off" class="layui-input" value="{$article.sougou}">
                                {else}
                                <input type="text" name="sougou" autocomplete="off" class="layui-input" value="{$config_price.sougou}">
                                {/if}
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6 layui-col-xs12">
                            <label class="layui-form-label">搜狗移动：</label>
                            <div class="layui-input-inline">
                                {if condition="$article.sougouM >0"}
                                <input type="text" name="sougouM" autocomplete="off" class="layui-input" value="{$article.sougouM}">
                                {else}
                                <input type="text" name="sougouM" autocomplete="off" class="layui-input" value="{$config_price.sougouM}">
                                {/if}
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6 layui-col-xs12">
                            <label class="layui-form-label">神马：</label>
                            <div class="layui-input-inline">
                                {if condition="$article.shenma >0"}
                                <input type="text" name="shenma" autocomplete="off" class="layui-input" value="{$article.shenma}">
                                {else}
                                <input type="text" name="shenma" autocomplete="off" class="layui-input" value="{$config_price.shenma}">
                                {/if}
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn" lay-submit="" lay-filter="btnAdd">保存</button>
                            <a class="layui-btn layui-btn-primary" href="javascript:parent.location.reload();">返回</a>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<script>
    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: '/lib/index' //主入口模块
    }).use(['index', 'table', 'form', 'laydate'], function () {
        var $ = layui.$, form = layui.form, layer = layui.layer, table = layui.table, laydate = layui.laydate;

        laydate.render({elem: '#serviceEndTime'});

        form.on('submit(btnAdd)', function (data) {
            $.post("{:url('edit_agent')}", data.field, function (result) {
                if (result['code'] == 0) {
                    layer.msg(result['msg'], {icon: 1, time: 1000}, function () {
                        parent.location.reload();
                    });
                } else {
                    layer.msg(result['msg'], {icon: 3, time: 3000});
                }
            });
            return false;
        });
    });
</script>
{/block}